package org.cmroot.certmaster.client.widgets;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.*;

/**
 * Copyright (c) 2011 Andrey Domas <andrey.domas at gmail.com>.
 * *
 * This file is part of certmaster.
 * *
 * Certmaster is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * *
 * Certmaster is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see http://www.gnu.org/licenses
 * or write to the Free Software Foundation,Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301  USA
 */
//TODO don't work!
public class LinkButton extends Composite {
    interface LinkButtonUiBinder extends UiBinder<Widget, LinkButton> {
    }

    private static LinkButtonUiBinder _linkButtonUiBinder = GWT.create(LinkButtonUiBinder.class);

    @UiField
    Label label;

    @UiConstructor
    public LinkButton(String text) {
        initWidget(_linkButtonUiBinder.createAndBindUi(this));
        label.setText(text);
    }

    public void addClickHandler(ClickHandler clickHandler) {
        label.addClickHandler(clickHandler);
    }
}